﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CiDotNet.WebCalc
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnCalculate_Click(object sender, EventArgs e)
        {
            txtRate.Text = CiDotNet.Calc.Math.RoundHelper.Round5Rappen((decimal)CiDotNet.Calc.Math.Finance.CalculateRate(int.Parse(txtPeriods.Text), 12, double.Parse(txtInterest.Text), double.Parse(txtPrice.Text), double.Parse(txtResidualValue.Text), rbModeBegin.Checked ? Calc.Math.Finance.Mode.BeginMode : CiDotNet.Calc.Math.Finance.Mode.EndMode)).ToString("0.00");
        }
    }
}